#include <iostream>
#include <cmath>
#include <stdio.h>
#include <lapack.h>
#include <lapacke_config.h>
#include <lapacke_utils.h>
using namespace std;

extern lapack_int LAPACKE_dgeev( int matrix_order, char jobvl, char jobvr, lapack_int n, double* a, lapack_int lda, double* wr, double* wi, double* vl, lapack_int ldvl, double* vr, lapack_int ldvr);

int main()
{
    int matrix_order = LAPACK_COL_MAJOR;
    char jobvl = 'N';
    char jobvr = 'V';
    int n = 50;
    double A[2500];
    for(int i = 0;i<50;i++)
    {
        for(int j = 0;i<50;i++)
        {
            A[i*50+j] = 0;
        }
    }
    A[0] = 3;
    A[1] = 1;
    for(int i = 1;i<49;i++)
    {
        A[i*51] = 3;
        A[i*51+1] = 1;
        A[i*51-1] = 1;
    }
    A[49*51] = 3;
    A[49*51-1] = 1;
    int lda = n;
    double wr[50];
    double wi[50];
    for(int i = 0;i<50;i++)
    {
        wr[i] = 0;
        wi[i] = 0;
    }
    double vl[2500];
    int ldvl = 50;
    double vr[2500];
    int ldvr = 50;

    int info = LAPACKE_dgeev(matrix_order,jobvl,jobvr,n,A,lda,wr,wi,vl,ldvl,vr,ldvr);
    if(info==0)
    {
        int i = 0;
        int j = 0;
        for(i=0;i<n;i++)
        {
            cout << "eigenvalue" << i << ":" << endl;
            cout << wr[i] << " + i " << wi[i] << endl;
        }
    }
    cout << "complete" << endl;
    
    return 0;
}